#include <iostream>
#include <thread>

using std::cout;
using std::endl;
using std::thread;

void threadFuncA()
{
    cout << "thread A id = " 
         << std::this_thread::get_id() << endl;
}

void threadFuncB()
{
    cout << "thread B id = " 
         << std::this_thread::get_id() << endl;
}

//线程的执行是随机的
int main(int argc, char *argv[])
{
    cout << "main thread id = " 
         << std::this_thread::get_id() << endl;

    thread thA(threadFuncA);
    thread thB(threadFuncB);

    thA.join();
    thB.join();

    return 0;
}

